using AutoMapper;
using ProduceBasicData.Api.Application.Command.DeviceManage;
using ProduceBasicData.Api.Application.Command.DeviceManage.Project;
using ProduceBasicData.Api.Application.Command.IncomingMaterialsManage;
using ProduceBasicData.Api.Application.Command.Incomings;
using ProduceBasicData.Api.Application.Command.InvoiceAndReceiptManage;
using ProduceBasicData.Api.Application.Command.Material.BOM;
using ProduceBasicData.Api.Application.Command.Material.Craft;
using ProduceBasicData.Api.Application.Command.Material.MaterialGroup;
using ProduceBasicData.Api.Application.Command.Material.ProductMaterial;
using ProduceBasicData.Api.Application.Command.Process;
using ProduceBasicData.Api.Application.Command.Production;
using ProduceBasicData.Api.Application.Command.ProductionManage;
using ProduceBasicData.Api.Application.Command.ProductionManage.Plan;
using ProduceBasicData.Api.Application.Command.RBAC.Department;
using ProduceBasicData.Api.Application.Command.RBAC.Permission;
using ProduceBasicData.Api.Application.Command.RBAC.Role;
using ProduceBasicData.Api.Application.Command.RBAC.User;
using ProduceBasicData.Api.Application.Command.Supplier;
using ProduceBasicData.Api.Application.Command.WarehouseManage;
using ProduceBasicData.Api.Application.Command.Workshop;
using ProduceBasicData.Api.Application.Command.Workstation;
using ProduceBasicData.Api.DTO;
using ProduceBasicData.Api.DTO.DeviceDto.ProjectDto;
using ProduceBasicData.Api.DTO.ProductionManage;
using ProduceBasicData.Api.DTO.WarehouseDto;
using ProduceBasicData.Domain.DeviceManage;
using ProduceBasicData.Domain.FactoryModeling;
using ProduceBasicData.Domain.IncomingMaterialsManage;
using ProduceBasicData.Domain.Inventories;
using ProduceBasicData.Domain.InvoiceAndReceiptManage;

using ProduceBasicData.Domain.Material;
using ProduceBasicData.Domain.ProductionManage;
using ProduceBasicData.Domain.RBAC;
using ProduceBasicData.Domain.WarehouseManage;
using ProduceBasicData.Domain.CodeGeneration;
using System.Data;
using System.Security;

namespace ProduceBasicData.Api
{
    public class MyAutoMapper : Profile
    {
        public MyAutoMapper()
        {
           
            //BOM
            CreateMap<CreateBOMCommand, BOMInfoModel>().ReverseMap();
            CreateMap<BOMDTO, BOMInfoModel>().ReverseMap();
            CreateMap<BOMTreeDTO, BOMInfoModel>().ReverseMap();
            CreateMap<UpdateBOMCommand, BOMInfoModel>().ReverseMap();
            //工艺路线
            CreateMap<CraftDTO, CraftModel>().ReverseMap();

            //物料群组
            CreateMap<CreateMaterialGroupCommand, MaterialGroupModel>().ReverseMap();
            //产品物料
            CreateMap<CreateProductMaterialCommand, ProductMaterialModel>().ReverseMap();

            //供应商
            CreateMap<CreateSupplierCommand, SupplierModel>().ReverseMap();
            CreateMap<UpdateSupplierCommand, SupplierModel>().ReverseMap();


            //获取产品
            CreateMap<ProductMange, Productdto>();
            //添加工单
            CreateMap<CreateWorkCommand, Work_order>();
            CreateMap<UpdateWorkCommand, Work_order>();



            //王依凡_车间管理
            CreateMap<CreateWorkshopCommand,Workshopmodel>().ReverseMap();
            CreateMap<UpdateWorkshopCommand,Workshopmodel>().ReverseMap();

            //王依凡_产线管理
            CreateMap<CreateProductionCommand, ProductionModel>().ReverseMap();
            CreateMap<UpdateProductionCommand, ProductionModel>().ReverseMap();

            //李一帆-排班
            CreateMap<EditScheduledto, Plan_Scheduling>();
            CreateMap<EditScheduledto, Plan_Scheduling>();

            //王依凡_工序维护
            CreateMap<CreateProcessCommand, ProcessModel>().ReverseMap();
            CreateMap<UpdateProcessCommand, ProcessModel>().ReverseMap();
            CreateMap<ProcessModel, ProcessDto>().ReverseMap();



            //王依凡_工位管理
            CreateMap<CreateWorkstationCommand, WorkstationModel>().ReverseMap();
            CreateMap<UpdateWorkstationCommand, WorkstationModel>().ReverseMap();

            CreateMap<Plan_SchedulingCreateCommand, Plan_Scheduling>();

            //吴怡_设备管理
            CreateMap<CreateDeviceTypeCommand, DeviceType>();
            CreateMap<UpdateDeviceTypeCommand, DeviceType>();
            CreateMap<CreateProjectFormCommand, ProjectForm>();
            CreateMap<UpdateProjectFormCommand, ProjectForm>();
            CreateMap<CreateProjectMaintenanceCommand, ProjectMaintenance>();
            CreateMap<UpdateProjectMaintenanceCommand, ProjectMaintenance>();
            CreateMap<ProjectMaintenance, ProjectMaintenanceDto>();
            //吴怡_来料检验
            CreateMap<CreateIncomingInspectionCommand, IncomingInspection>();
            CreateMap<UpdateIncomingInspectionCommand, IncomingInspection>();
            CreateMap<CreateInspectionSchemeCommand, InspectionScheme>();
            CreateMap<UpdateInspectionSchemeCommand, InspectionScheme>();
            //吴怡_RBAC
            CreateMap<CreateUserCommand, UserModel>();
            CreateMap<UpdateUserCommand, UserModel>();
            CreateMap<CreateRoleCommand, RoleModel>();
            CreateMap<UpdateRoleCommand, RoleModel>();
            CreateMap<CreatePermissionCommand, PermissionModel>();
            CreateMap<UpdatePermissionCommand, PermissionModel>();
            CreateMap<CreateDepartmentCommand, DepartmentModel>();
            CreateMap<UpdateDepartmentCommand, DepartmentModel>();
            CreateMap<OperLogModel, OperLogModel>();
            //吴怡_仓库管理
            CreateMap<CreateWarehouseCommand, Warehouse>();
            CreateMap<UpdateWarehouseCommand, Warehouse>();
            CreateMap<CreateStockInOrderCommand, StockInOrder>();
            CreateMap<UpdateStockInOrderCommand, StockInOrder>();
            CreateMap<CreateStockInOrderItemCommand, StockInOrderItem>();
            CreateMap<CreateStockOutOrderCommand, StockOutOrder>();
            CreateMap<UpdateStockOutOrderCommand, StockOutOrder>();
            CreateMap<StockInOrder, StockInOrderDto>();
            CreateMap<StockOutOrder, StockOutOrderDto>();
            CreateMap<StockInOrderItem, StockInOrderItemDto>();
            CreateMap<Inventory, InventoryDto>();
            CreateMap<Plan_SchedulingCreateCommand, Plan_Scheduling>();
            //吴怡_开票到票
            CreateMap<CreateInvoiceCommand, Invoice>();
            CreateMap<UpdateInvoiceCommand, Invoice>();
            CreateMap<CreateReceiptCommand, Receipt>();
            CreateMap<UpdateReceiptCommand, Receipt>();




            CreateMap<CreateIncomingsCommand,IncomingMaterials>().ReverseMap();

            //李一帆工艺路线
            CreateMap<CreateCraftCommand,CraftModel>();
            CreateMap<UpdateCraftCommand, CraftModel>();

            //编码生成规则
            CreateMap<CreateCodeRuleRequest, CodeRule>();
            CreateMap<UpdateCodeRuleRequest, CodeRule>();
            CreateMap<CodeRule, CodeRuleResponse>();

            CreateMap<UpdateMaterialGroupCommand, MaterialGroupModel>().ReverseMap();

        }
    }
}
